import request from '@/utils/request'

export function getProperties(params) {
  return request({
    url: `/properties`,
    params
  })
}

export function getPropertiesCount(params) {
  return request({
    url: `/properties/count`,
    params
  })
}

export function delProperty(id) {
  return request({
    url: `/properties/${id}`,
    method: 'delete'
  })
}

export function addProperty(data) {
  return request({
    url: `/properties`,
    method: 'post',
    data
  })
}

export function getPropertyDetail(id) {
  return request({
    url: `/properties/${id}`
  })
}

export function updateProperty(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'put',
    data
  })
}
